<template>
  <div class="tags">
    <el-tag v-for="tag in tagsList" 
    :key="tag.name" 
    :closable="tag.name!='home'"
    :effect="$route.name==tag.name?'dark':'light'"
    @click="changeNav(tag)"
    @close="closeNav()"
    >
      {{ tag.label }}
    </el-tag>
  </div>
</template>

<script>
import {mapState} from "vuex"
export default {
  name: 'Tag',
  computed:{
    ...mapState({
        tagsList:state=>state.nav.tagsList
    })
  },
  methods:{
    changeNav(tag){
        this.$router.push({name:tag.name})
    }
  }
};
</script>
<style></style>
